package com.acme.bankapp.account;


/**
 * @author Andrey Alekov
 * Saving account implementation
 */
public class SavingAccount extends AbstractAccount{

	public SavingAccount(double amount) {
		super(amount);
	}

	@Override
	public void deposit(double amount) {
		balance += amount;
	}

	@Override
	public boolean withdraw(double amount) {
		if (balance < amount){
			return false;
		}
		balance -= amount;
		return true;
	}

	@Override
	public double maximumAmountToWithdraw() {
		return balance;
	}

}
